﻿using System;
using System.Web.UI.WebControls;
using BLL;

public partial class ProductPCBAging_ViewPCBAging_ViewPCBAgingbyDT : System.Web.UI.Page
{
    private PCBAging pag;

    public ProductPCBAging_ViewPCBAging_ViewPCBAgingbyDT()
    {
        pag = new PCBAging();
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        BindPCBAging();
    }

    protected void BindPCBAging()
    {
        DateTime dt1 = DateTime.Parse(this.TextBox1.Value.Trim());
        DateTime dt2 = DateTime.Parse(this.TextBox2.Value.Trim());
        this.GridView1.DataSource = pag.GetPCBAgingsbyDT(dt1, dt2);
        this.GridView1.DataBind();
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            GridView1.Rows[i].Cells[5].Text = "24小时";
            GridView1.Rows[i].Cells[6].Text = "65℃";
            if (GridView1.Rows[i].Cells[8].Text == "1900/1/1 0:00:00" && GridView1.Rows[i].Cells[10].Text == "0.00" && GridView1.Rows[i].Cells[11].Text == "0.00")
            {
                GridView1.Rows[i].Cells[8].Text = "";
                GridView1.Rows[i].Cells[10].Text = "";
                GridView1.Rows[i].Cells[11].Text = "";
            }
            if (GridView1.Rows[i].Cells[13].Text == "1900/1/1 0:00:00" && GridView1.Rows[i].Cells[14].Text == "0.00" && GridView1.Rows[i].Cells[15].Text == "0.00")
            {
                GridView1.Rows[i].Cells[12].Text = "";
                GridView1.Rows[i].Cells[14].Text = "";
                GridView1.Rows[i].Cells[15].Text = "";
            }
        }
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindPCBAging();
    }
}
